<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>日夜更迭，往复不止</title>
    <style>
        * {
            margin: 0;
        }

        :root,
        body {
            background-color: #000;
            overflow: hidden;
            width: 100%;
            height: 100%;
        }

        .wrapper {
            display: flex;
            width: 100%;
            height: 100%;
            flex-direction: column;
        }

        .top {
            flex: 1 1 65%;
            /* border: 1px solid red; */
            background-image: linear-gradient(to bottom, rgba(0, 130, 255, 1), rgba(255, 255, 255, 1));
            box-sizing: border-box;
            animation: space 20s cubic-bezier(.5, 1, 1, .9) infinite;
            transition: all 20s;
        }

        @keyframes space {
            0% {
                opacity: .3;
            }

            25% {
                opacity: 1;
            }

            50% {
                opacity: .3;
            }

            75% {
                opacity: .1;
            }

            85% {
                opacity: 0.1;
            }

            100% {
                opacity: 0.3;
            }
        }

        @keyframes sunrise {
            from {
                opacity: 0;
            }

            10% {
                opacity: 1;
                transform: scale(.7, .7) translateX(0) translateY(0);
            }

            30% {
                opacity: 1;
                transform: scale(.5, .5) translateX(0) translateY(-500px);
            }

            50% {
                opacity: 0;
                transform: scale(.8, .8) translateX(400px) translateY(0);
            }

            to {
                opacity: 0;
            }
        }

        @keyframes moonrise {
            0% {
                opacity: 0;
                transform: translateY(0);
            }

            30% {
                transform: translateY(0);
            }

            50% {
                opacity: 0;
                transform: translateY(0);
            }

            60% {
                opacity: .1;
                transform: translateY(0);
            }
          65%{
              opacity: .5;
          }
            70% {
                transform: translateY(-300px) translateX(-200px);
                opacity: 1;
            }

            80% {
                transform: translateY(-300px) translateX(-200px);
                opacity: 1;
            }

            90% {
                opacity: 0;
            }

            to {
                transform: translateY(0);
                opacity: 0;
            }
        }

        .sun {
            position: absolute;
            left: calc(50% - 50px);
            top: calc(50% - 25px);
            width: 50px;
            height: 50px;
            background-color: #fff;
            border-radius: 50%;
            transform: scale(.5, .5);
            box-shadow: 0px 0px 100px 50px #fff,
                0px 0px 250px 125px #ff0;
            animation: sunrise 20s cubic-bezier(0,0,.7,.7) infinite;
        }

        .moon {
            position: absolute;
            left: calc(50% + 400px);
            top: calc(50% - 25px);
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background-color: #fff;
            box-shadow: 0 0 8px #fff,
                inset 0 0 8px #000;
            animation: moonrise 20s cubic-bezier(0, 0, .5, .5) infinite;
        }

        .moon::after {
            position: absolute;
            content: '';
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background-color: #000;
            left: -15px;
            top: -15px;
            /* animation: ball 10s cubic-bezier(0, 0, .5, .5) infinite; */
        }

        .bottom {
            flex: 1 1 35%;
            /* border: 1px solid #fff; */
            box-sizing: border-box;
            /* border-top-left-radius: 50%; */
            /* border-top-right-radius: 50%; */
        }
    </style>
</head>

<body>
    <div class="wrapper">
        <div class="top">
            <div class="sun"></div>
            <div class="moon"></div>
        </div>
        <div class="bottom"></div>
    </div>
</body>

</html>